import 'package:flutter/material.dart';

class Register2 extends StatefulWidget {
  var arguments;

  Register2({Key? key, this.arguments = '没有传值'}) : super(key: key);

  @override
  _Register2State createState() => _Register2State();
}

class _Register2State extends State<Register2> {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text('注册2页面'),
      ),
      body: Column(
        children: [
          SizedBox(
            height: 300,
          ),
          ElevatedButton(
              onPressed: () {
                var arguments = widget.arguments;
                print('arguments${widget.arguments}');
                arguments['name'] = 'register2 name';
                Navigator.pushNamed(context, '/register3',
                    arguments: arguments);
                // Navigator.pushNamed(context, '/register3');
              },
              // child: Text('注册2->注册3==>${widget.arguments}')),
              child: Text('注册2->注册3==>')),
        ],
      ),
    );
  }
}
